/*
	Copyright (C) 2009 jungil Han <jungil.Han@gmail.com>

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef __MKHTTPDOWNLOADER_H__
#define __MKHTTPDOWNLOADER_H__

#include "../Base/Http/mkHttp.h"

class QByteArray;

class mkHttpDownloader : public mkHttp {
public:
	mkHttpDownloader( QObject *a_pParent = NULL );
	~mkHttpDownloader();

	void RequestFavicon();
	virtual int Connect();

protected:
	virtual void OnFinished( IN QByteArray &a_baHttpData );

	QByteArray ParseCharset( IN QByteArray &a_refHttpData );
	QByteArray ParseTitle( IN QByteArray &a_refHttpData );

	void DownloadedFavion( IN QByteArray &a_refHttpData );
	void MakeFaviconFileName( OUT QString &a_refFileName );
	void SaveFavicon( IN QByteArray &a_refHttpData, IN QString &a_refFileName );

private:

};

#endif /* __MKHTTPDOWNLOADER_H__ */
